package com.atguigu.tingshu.search.api;

import com.atguigu.tingshu.common.result.Result;
import com.atguigu.tingshu.search.service.ItemService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;
import java.util.Objects;

@Tag(name = "专辑详情管理")
@RestController
@RequestMapping("api/search/albumInfo")
@SuppressWarnings({"all"})
public class itemApiController {

	@Autowired
	private ItemService itemService;


	@Operation(summary = "获取专辑详情页面")
	@GetMapping("{albumId}")
	public Result getAlbumDetails(@PathVariable("albumId") Long albumId){
		/**
		 * 获取专辑详情页面
		 * 这里的返回值定义成map<string，object>
		 * data:{
		 *     albumInfo:{...}
		 *     albumStatVo:{...}
		 *     announcer:{...}
		 *     baseCategoryView:{...}
		 * }
		 */
		//调用服务层方法
		Map<String, Object> map=itemService.getAlbumDetails(albumId);
		return Result.ok(map);
	}

}

